﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class Admin_StudentPostings : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
       
        DataSet ds1 = null;
        string userID =null;
        
        PostingDAO postDAO = new PostingDAO();
        if (Request["UserID"] != null)        
            userID = Request["UserID"].ToString();                    
        if(Session["User"]!=null)
             userID = Session["User"].ToString();
        UserDAO uDAO = new UserDAO();
        txtStName.Text = "Postings of " + uDAO.GetName(userID) + " Student";
        ds1 = postDAO.GetPostingInfoByStudentID(userID);
        if (ds1.Tables.Count > 0)
        {
            grv_Posting.DataSource = ds1;
            grv_Posting.DataBind();
        }
        else        
            lb_Mess.Text = "No postings";
        if (Request["PostingID"] != null)
        {
            Control ct;
            ct = Page.LoadControl("~/Share/PostingDetailControl.ascx");
            pn_PostingDetail.Controls.Add(ct);
            
        }
    }
}